﻿#include "TurnTableDecode_Thermostat_CurrentTemperature.h"

#include "TurnTableCodec.h"
#include "RegisterCenter_Device.h"
#include "Device.h"

TurnTableDecode_Thermostat_CurrentTemperature::TurnTableDecode_Thermostat_CurrentTemperature(TurnTableCodec *turnTableCodec)
{
  setObjectName(getClassNameFirstLow<TurnTableDecode_Thermostat_CurrentTemperature>());
  this->turnTableCodec=turnTableCodec;
}

TurnTableDecode_Thermostat_CurrentTemperature::~TurnTableDecode_Thermostat_CurrentTemperature()
{

}

void TurnTableDecode_Thermostat_CurrentTemperature::decode(char* const data,uint deviceId)
{
  registerCenter_Device->getDeviceById(deviceId)->setTurnTable_thermostat_currentTemperature(dataBodyToFloat(data,1));
}

RegisterCenter_Device* TurnTableDecode_Thermostat_CurrentTemperature::getRegisterCenter_Device()const
{
  return registerCenter_Device;
}

TurnTableDecode_Thermostat_CurrentTemperature* TurnTableDecode_Thermostat_CurrentTemperature::setRegisterCenter_Device(RegisterCenter_Device* const registerCenter_Device)
{
  this->registerCenter_Device=registerCenter_Device;
  printInjection(this,registerCenter_Device);
  return this;
}

void TurnTableDecode_Thermostat_CurrentTemperature::objectAutoInjection(QHash<QString,QObject*>* objMap)
{
  setRegisterCenter_Device(getObjFromMap<RegisterCenter_Device>(objMap));
}
